import { GlobalClass } from "../../../../../com/mui/core/GlobalClass";
import { ImagesConst } from "../../../resource/ImagesConst";
import { ObjCreate } from "../../common/ObjCreate";
import { HTMLUtil } from "../../../../../com/gengine/utils/HTMLUtil";
import { Language } from "../../../../../extend/language/Language";
import { EquimentContrastUtil } from "../../common/EquimentContrastUtil";
type int = number;
//class GuideEquipComp
    
    export  class GuideEquipComp /* flash.display.Sprite */
    {
        constructor(arg1: int)
        {
            
            this._width = arg1;
            this.initUI();
            return;
        }

        protected initUI(): void
        {
            mouseEnabled == false;
            mouseChildren = false;
            this._line = GlobalClass.getBitmap(ImagesConst.SplitLine);
            this._line.width = this._width;
            this._textInfo = ObjCreate.createTextField("", 0, 0, this._width, 20, this);
            this._textInfo.htmlText = HTMLUtil.addColor(Language.getString(20087), "#00ff00");
            this._textInfo.x = 0;
            this._textInfo.y = this._line.y + 6;
            return;
        }

        public updateData(arg1: int): void
        {
            var loc2=0;
            var loc4=null;
            var loc5=0;
            var loc6=null;
            var loc7=null;
            addChild(this._line);
            addChild(this._textInfo);
            this._height = this._textInfo.y + this._textInfo.textHeight + 4;
            var loc1=EquimentContrastUtil.getContrastValueArrayByItemCode(arg1);
            var loc3=loc1.length;
            while (loc2 < loc3) 
            {
                if ((loc5 = (loc4 = loc1[loc2])["value"]) > 0) 
                {
                    (loc7 = GlobalClass.getBitmap(ImagesConst.Fire)).y = this._textInfo.y + this._textInfo.textHeight + 4 + loc2 * 22;
                    addChild(loc7);
                    (loc6 = ObjCreate.createTextField("", loc7.width + 2, loc7.y + 8, 100, 20, this)).htmlText = HTMLUtil.addColor(loc4["name"], "#ffff00") + HTMLUtil.addColor(" +" + loc5, "#00ff00");
                    this._height = this._height + 22;
                }
                else if (loc5 < 0) 
                {
                    (loc7 = GlobalClass.getBitmap(ImagesConst.Fire)).y = this._textInfo.y + this._textInfo.textHeight + 4 + loc2 * 22;
                    addChild(loc7);
                    (loc6 = ObjCreate.createTextField("", loc7.width + 2, loc7.y + 8, 100, 20, this)).htmlText = HTMLUtil.addColor(loc4["name"], "#ffff00") + HTMLUtil.addColor(" -" + (-loc5), "#ff0000");
                    this._height = this._height + 22;
                }
                ++loc2;
            }
            return;
        }

        public dispose(): void
        {
            while (numChildren > 0) 
            {
                removeChildAt(0);
            }
            return;
        }

        public /* override */ get height(): number
        {
            return this._height;
        }

        public /* override */ get width(): number
        {
            return this._width;
        }

        /* internal */ /* var */_line: Object /* flash.display.Bitmap */;

        /* internal */ /* var */_textInfo: Object /* flash.text.TextField */;

        /* internal */ /* var */_width: int;

        /* internal */ /* var */_height: int;
    }
